package com.travel.controller.user;

import com.travel.mapper.UserMapper;
import com.travel.pojo.dto.UserDTO;
import com.travel.pojo.entity.User;
import com.travel.service.IUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("userLoginController")
@RequiredArgsConstructor
@RequestMapping("/user")
@CrossOrigin
public class UserLoginController {

    private final IUserService userService;

    @GetMapping("/login")
    public User login(UserDTO userDTO){
        return userService.login(userDTO);
    }
}
